/*
 * SDeviceVirtual.h
 *
 *  Created on: 6 déc. 2010
 *      Author: sm228513
 */

#ifndef SDEVICEVIRTUAL_H_
#define SDEVICEVIRTUAL_H_


#include <QString>
#include <QObject>
#include <QScriptable>

////////////////////////////////////////////////////////////////////////////////////////////////////
/// \class	SDeviceVirtual
///
/// \brief	Virtual class for all the devices. It is virtual pur so it cannot be instancied.
///
/// \author	Sylvain Martin
/// \date	1/20/2011
/// 		
/// \ingroup SDeviceMod
////////////////////////////////////////////////////////////////////////////////////////////////////

class SDeviceVirtual:public QObject, protected QScriptable {
	Q_OBJECT;

public:

	 SDeviceVirtual(QObject *parent=0);

	 Q_INVOKABLE virtual void init () = 0;
	 Q_INVOKABLE virtual QString name () const = 0;
	 Q_INVOKABLE virtual QString description()const = 0;

	 Q_INVOKABLE QString log();
	 Q_INVOKABLE void addLog(QString log);
	 Q_INVOKABLE void clearLog();

	 Q_INVOKABLE virtual bool available()=0;
	 Q_INVOKABLE virtual void setUnavailable();

protected:
	void delay(double i);
	QString log_;
	bool available_;
};



#endif /* SDEVICEVIRTUAL_H_ */
